package com.qm.console.service.impl;

import com.qm.console.dao.dm.SysPermissionMapper;
import com.qm.console.model.SysPermission;
import com.qm.console.service.SysPermissionService;
import com.qm.console.service.SysPermissionService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysPermissionServiceImpl implements SysPermissionService {
    @Autowired
    SysPermissionMapper sysPermissionMapper;

    @Override
    public List<SysPermission> getSysPermissionListByParentId(int parentId) {
        return sysPermissionMapper.getSysPermissionListByParentId(parentId);
    }

    @Override
    public List<SysPermission> listAllByLevel() {
        return sysPermissionMapper.listAllByLevel();
    }

    @Override
    public List<SysPermission> listAllByLevel(int maxLevel) {
        return sysPermissionMapper.listAllByLevelLte(maxLevel);
    }
}
